package com.xuxin.baby.adapter;

import android.widget.ImageView;

import com.blankj.utilcode.util.LogUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.xuxin.baby.R;
import com.xuxin.baby.bean.CategoryBean;
import com.xuxin.baby.glide.GlideApp;
import com.xuxin.baby.network.Retrofit;

import org.jetbrains.annotations.NotNull;

/**
 * Created by xu_xin
 * Created on 2020.08.04 0004
 * 儿童保健
 */
public class HealthExtendAdapter extends BaseQuickAdapter<CategoryBean.ResultBean, BaseViewHolder> {

    public HealthExtendAdapter() {
        super(R.layout.item_health);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, CategoryBean.ResultBean item) {
        holder.setText(R.id.item_health_name, item.getCategoryName());
        /**
         * 加载图片
         */
        ImageView item_health_image = holder.getView(R.id.item_health_image);
        String healthImage = Retrofit.image_url + item.getIcons();
        LogUtils.e("儿童保健_image = " + healthImage);
        GlideApp.with(getContext()).load(healthImage).placeholder(R.mipmap.img_placeholder160).centerCrop().into(item_health_image);
    }
}